<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page language="java" import="java.util.*,com.spera.shopoa.util.ShopOaSessionUtil
,com.spera.shopoa.util.ShopOaSessionUtil.OaUser,com.spring.security.core.annotation.OaUserPermission" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/view/common/kendocommon.jsp"%>

<!DOCTYPE html>
<html>
<head>
    <title>结账</title>
    <script src="http://cdn.dibabo.cn/Scripts/require.min.js"></script>
    <meta charset="utf-8">
    <style>
    	table{font-size:12px}
    	.btn{
			display: inline-block; 
			width: 80px;
			height: 40px;
			border-radius:4px;
			border: 1px solid #CCC;
			background: #F5F5F5;
			padding-top: 10px;
			text-align:center;
		}
		h1 {
			font: 14px "Helvetica Neue", Helvetica, Arial, sans-serif;
			padding: 0px 0px 10px 10px;
			display: block;
			border-bottom: 1px solid #DADADA;
			margin: 5px 10px 10px 5px;
			color: #888;
		}
		
		.k-toolbar label{
			display:inline-block;
		}		

     @media print { 
	.noprint { display: none; }
	} 
	.tools_button{
		background:#FFFFFF;border-radius:8px;;margin-left:10px;
		width:120px; height:40px; font-size:30px; border: 1px solid #CCCCCC
	}

    </style>

    <%	
    OaUser oaUser = ShopOaSessionUtil.getOaUser(request);
	String userID = null;
	String userName =null;
	String deptID=null;
	
	if(oaUser!=null){
		userID = oaUser.getOa_user_id();
		userName = oaUser.getOa_user_name();
		deptID =oaUser.getUser_dept_id();
	}
	
	%>
	<!--  <script src="${basepath}/js/LodopFuncs.js"></script>-->
	<script src="http://cdn.dibabo.cn/Scripts/LodopFuncs.js"></script>
	<script src="${basepath}/js/timeParse.js" type="text/javascript"></script>
 	<script src="${basepath}/js/consumeBackground/checkOut.js" type="text/javascript"></script>
 	<script>
 	 var deptID='<%=deptID%>';
 	 var cashierID="<%=userID%>";
 	 var cashierName='<%=userName%>';
 	 var path='${path}';
 	</script>
</head>
<body>
	<div class="noprint">
	<div id="toolbar" style="padding-top:10px; padding-bottom:10px;"></div>
	<table>
		<tr>
			<td style="width:60%;padding:4px" valign="top">
				<h1 style="font-size:12px">会员卡内容</h1>
         		<div id="cardContent" style="margin-top:0px;display:block"></div>
			</td>
			<td style="width:39%;padding:4px;" valign="top">
				<h1 style="font-size:12px">充值卡内容</h1>
         		<div id="rechargeCard" style="margin:2px;display:block"></div>
			</td>
		</tr>
	</table>
	
	
	<h1 style="font-size:12px">产品列表</h1>
    <div id="grid" style="margin:2px;font-size:10px"></div>
	
	<div style='float:right;margin:30px' id="" >
		<div><span style='font-size:15px'>总金额： </span><span style='font-size:15px' id='totalAmount'></span></div>
		<div><span style='font-size:15px'>需支付： </span><span style='font-size:15px' id='needPay'></span></div>
		<div><span style='font-size:15px'>现金支付： </span><span style='font-size:15px' id='remainNeedPay'></span></div>
		<div><span style='font-size:15px'>打折后现金支付：  </span><span style='font-size:15px' id='dzhRemainNeedPay'></span></div>
		<div style="margin-top:4px">
			<a href="#" onclick="checkOut()" class="k-button k-primary" style="padding-bottom:1px; width:160px; height:60px; font-size:30px;">结账</a>
		</div>
	</div>
	
	<div style="display: none;">		
		<div id="CheckContent" style="width:700px;overflow:auto;">
			<h1 style="font-size:14px">订单详细:</h1>
			<div>
				<table id="order_detail">
					<tr>
	    				<th style="width:100px;padding-left:15px">业务代码</th>
	    				<th style="width:100px;padding-left:15px">商品名</th>
	    				<th style="width:100px;padding-left:15px">单位</th>
	    				<th style="width:100px;padding-left:15px">数量</th>
	    				<th style="width:100px;padding-left:15px">金额</th>
	    				<th style="width:130px;padding-left:15px">是否使用会员卡</th>
	 			   </tr>	
                </table>
			</div>
			<h1 style="font-size:14px">支付方式:</h1>
			<div style="float:left">
				<table id="order_payment">
	                <tr>
	    				<th style="width:100px;padding-left:15px">支付方式</th>
	    				<th style="width:100px;padding-left:15px">卡号</th>
	    				<th style="width:100px;padding-left:15px">支付金额</th>
	    				<th style="width:100px;padding-left:15px">原价金额</th>
	 			    </tr>
                </table>
			</div>
			<div style="text-align:center;float:right;display:none" id="printButton">
                <a href="#" onclick="printContract()" class="btn" >打印</a>
             </div>
			<div style="clear:both">
				<table >
                <tr>
                    <td style="width:120px;padding:15px">
                    	<span style='font-size:14px;'>应付现金</span>
                    </td>
                    <td style="width:100px;padding:5px;" id="total_amount">
                    </td>
                </tr>
                <!--<tr>
                    <td style="width:100px;padding:15px"><span style='font-size:20px'>实付现金</span></td><td style="width:100px;padding:5px" id="payment_amount"></td>
                </tr>-->
                </table>

                </div>
                
                <div style="text-align:center">
                	<a href="#" onclick="submitContent()" class="btn" >确定</a>
                </div>
			</div>
		</div>
    </div>            

</div>
  
   <div style="display:none">
  <iframe id="iframe" src=""  ></iframe>
  
</div>
  
  <object id="WebBrowser" classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" height="0"  width="0">   </object>  
  
  <!--;display:none  -->
  <div style="width:270px;padding-right:20px;page-break-after:always;display:none" id="receipt" >

    <span style="font-size:18px;padding-left:50px">结账单</span><br />
    	
    	<div><span class="receiptsp"  style="font-size:12px">单号:	 </span><span class="receiptsp"  id='receiptNumber' style="font-size:12px;font-family:'MS Gothic'"></span></div>		
		<div id="dCardOutNumber" style="display:none"><span class="receiptsp" style="font-size:12px">会员卡号: </span><span class="receiptsp"  id='cardOutNumber' style="font-size:12px;font-family:'MS Gothic'"></span></div>		
		<div><span class="receiptsp" style="font-size:12px">收银员: </span><span class="receiptsp"  id='receiptPerson' style="font-size:12px"><%=userName %></span></div>
		<div><span class="receiptsp" style="font-size:12px">时间: </span><span class="receiptsp"  id='receiptTime' style="font-size:12px;font-family:'MS Gothic'"></span></div>
 
	 
    <table class="receipttable" style="font-size:12px">
   
    	<!-- <b><hr class="receipthr" /></b> -->
    	<tr>
    	<td colspan="3" class="receiptline"  style="width:280px">
    	<div style="height:20px;line-height:20px;overflow:hidden">
    	----------------------------------------------------------------
    	</div>
    	</td>
    	</tr>
		<tr>
			<td class="receiptth" style="width:160px">产品名</td>
			<td class="receiptth" style="width:60px">数量</td>
			<td class="receiptth" style="width:60px">价格</td>
	   </tr>	
   </table>
   	 	
   	    
   	    <table class="receipttable" id="receiptItem" style="font-size:12px">
   	    <tr>
   	 	<td colspan="3" class="receiptline"  style="width:280px">
    	<div style="height:20px;line-height:20px;overflow:hidden">
    	------------------------------------------------------------------------
    	</div>
    	</td>
    	</tr>
   	    
   	    
   	    
   </table>
       <table class="receipttable" style="font-size:12px">

    	<tr>
   	 	<td colspan="3" class="receiptline"  style="width:280px">
    	<div style="height:20px;line-height:20px;overflow:hidden">
    	------------------------------------------------------------------------
    	</div>
    	</td>
    	</tr>

      </table>	
      	
   <div><span class="receiptsp" style="font-size:12px;">总金额: </span><span class="receiptsp"  id='receiptTotal' style="font-size:12px;font-family:'MS Gothic';"></span></div>
   <div><span class="receiptsp" style="font-size:12px;">会员卡抵扣: </span><span class="receiptsp"  id='dikou' style="font-size:12px;font-family:'MS Gothic';"></span></div>     
   <div><span class="receiptsp" style="font-size:12px;">折扣：- </span><span class="receiptsp"  id='zhekou' style="font-size:12px;font-family:'MS Gothic';"></span></div>
   
    <!--  <div><span class="receiptsp" style="font-size:12px;">需支付: </span><span class="receiptsp"  id='receiptNeedPay' style="font-size:12px;font-family:'MS Gothic';"></span></div>
    -->
    <div><span class="receiptsp" style="font-size:12px;">实际支付: </span><span class="receiptsp"  id='receiptPaid' style="font-size:12px;font-family:'MS Gothic';"></span></div>
    <div id="dBalance" style="display:none"><span class="receiptsp" style="font-size:12px;">卡内余额: </span><span class="receiptsp"  id='balance' style="font-size:12px;font-family:'MS Gothic';"></span></div>
    <div id="dWxPoint" style="display:none"><span class="receiptsp" style="font-size:12px;">梦想基金余额: </span><span class="receiptsp"  id='wx_point' style="font-size:12px;font-family:'MS Gothic';"></span></div>
    
    	 </table>
       <table class="receipttable">

    	<tr>
   	 	<td colspan="3" class="receiptline"  style="width:280px">
    	<div style="height:20px;line-height:20px;overflow:hidden">
    	------------------------------------------------------------------------
    	</div>
    	</td>
    	</tr>

      </table> 
      	  
   </div>  
  
  <div id="dialog"></div>
	
</body>
</html>
